package com.hilog.orderservice.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * 商品服务Feign客户端
 */
@FeignClient(name = "product-service", url = "http://localhost:8081")
public interface ProductFeignClient {

    /**
     * 调用商品服务的购买接口
     * @param productId 商品ID
     * @param traceId 链路追踪ID
     * @return 购买结果
     */
    @GetMapping("/product/buy/{productId}")
    Map<String, Object> buyProduct(@PathVariable("productId") String productId, 
                                   @RequestHeader("X-Trace-Id") String traceId);
} 